package com.nafets;

public class NeckPosition {
	private int string;
	private int fret;
	
	public NeckPosition(int string, int fret) {
		this.string = string;
		this.fret = fret;
	}

	public int getString() {
		return string;
	}

	public int getFret() {
		return fret;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + fret;
		result = prime * result + string;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		NeckPosition other = (NeckPosition) obj;
		if (fret != other.fret)
			return false;
		if (string != other.string)
			return false;
		return true;
	}
	
	@Override
	public String toString() {
		return String.format("[%d, %d]", string, fret);
	}

}
